package com.nanbei.graph;


import lombok.Data;

/**
 * @ClassDescription:  图的边
 * @JdkVersion: 1.8
 * @Author: libs
 * @Created: 2024/7/1 14:46
 */

public class Edge {

    // 边指向的另外一个顶点
    private Vertex linked;
    // 边的权重（默认为1）
    private int weight;

    public Edge(Vertex linked) {
        this(linked, 1);
    }

    public Edge(Vertex linked, int weight) {
        this.linked = linked;
        this.weight = weight;
    }

    public Vertex getLinked() {
        return linked;
    }

    public void setLinked(Vertex linked) {
        this.linked = linked;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
